<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/common.jsp"%>
<%@ page import="com.chanyachting.emall.util.*" %>
<%@ page import="java.util.*" %>

<%@ page import="com.chanyachting.emall.domain.*" %>
<%@ page import="com.chanyachting.emall.util.RequestUtil" %>
<%@ page import="com.chanyachting.emall.service.*" %>
<%@ page import="com.chanyachting.emall.serviceImpl.*" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" /> 
<meta name="description" content="" />
<link href="css/import.css" type="text/css" rel="stylesheet" />
<title></title>


</head>


<%

	//获得公司产品对象
	RequestUtil ru=new RequestUtil(request);

	Companyproduct cp=(Companyproduct)ru.getAttribute("companyproduct",new Companyproduct());
	
%>

<body>
<div class="tab_box">
	<div class="tab_menu">
    	<a href="product_nomal_create.jsp" class="current">修改普通商品</a>
    </div>
	<div class="tab_submenu">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="50%">&nbsp;</td>
          <td align="right"><strong><a href="#">预览</a><a href="#">打印</a><a href="#">导出</a></strong></td>
        </tr>
      </table>
	</div>
</div>

<div><%= ru.getMsg() %></div>


<form action="<%=root %>/memberBackend/nomalProductUpdate.do" method="post" enctype="multipart/form-data" name="form3" id="form3">

<input type="hidden" name="id" value="<%= cp.getId() %>" />
<input type="hidden" name="companyId" value="<%= cp.getCompanyId() %>" />


  <div id="bigbox">
    <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="50%"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="100" height="28" align="right">产品名称：</td>
            <td><label>
              <input type="text" name="name" id="textfield57" value="<%= cp.getName() %>"/>
            </label></td>
          </tr>
          <tr>
            <td height="28" align="right">产品介绍：</td>
            <td><label>
              <textarea name="summary" id="textarea4" cols="45" rows="5"><%= cp.getSummary() %></textarea>
            </label></td>
          </tr>
          
       
          
        </table></td>
        <td valign="bottom"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td height="28" align="right"></td>
              <td><img src="<%=cp.getImgUrl() %>" width="128" height="86" /></td>
            </tr>
            <tr>
              <td width="100" height="28" align="right">修改图片：</td>
              <td><label>
                <input type="file" name="file" id="fileField5" />
              </label></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td valign="bottom">&nbsp;</td>
        <td valign="bottom">&nbsp;</td>
      </tr>
    </table>
    <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
    
      <tr>
        <td colspan="3" class="td_top">&nbsp;</td>
      </tr>
      <tr>
        <td width="100" height="28"  align="left"><div class="ptitle">图文信息</div></td>
        <td width="230" height="28"  align="right">产品标题：</td>
        <td width="370"><p>
            <label>
            <input type="text" name="title" id="textfield55" value="<%= cp.getTitle() %>"/>
            </label>
        </p></td>
       
      </tr>
      <tr>
        <td colspan="2" align="right" valign="top">产品/服务描述：</td>
        <td height="28" valign="top"><label>
          <textarea name="productdesc" id="textarea8" cols="45" rows="5"><%= cp.getProductdesc() %></textarea>
        </label></td>
      </tr>
      <tr>
        <td colspan="3" align="right" class="td_bottom">&nbsp;</td>
      </tr>
      <tr>
        <td colspan="3" class="td_bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          
          <tr>
            <td align="center" colspan="5">&nbsp;</td>
          </tr>
          
          <%
          	//获得商品图片列表
          	List<Productimage> list=Productimage.listByProductId(cp.getId());
          
          	for(int i=0;i<list.size();i++){
          		
          		Productimage pimg=(Productimage)list.get(i);
          		
          		String imgUrl=pimg.getImgUrl();
          		
          		if(imgUrl==null) imgUrl="";
          		
    		%>
    	 <tr>
            <td height="40" colspan="5" align="left">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="100" align="right"> <img src="<%=imgUrl %>"  width="98" height="56" alt="" /> </td>
                  <td><input type="file" name="pimg<%=i %>" id="fileField2" /></td>
                  <td>描述（选填）：<input name="imgdesc<%=i %>" value="<%=pimg.getSummary() %>"/></td>
                </tr>
            </table>
            </td>
          </tr>
    		
    		<%
          		
          	}
          
          %>
          
     
        
          
          <tr>
            <td align="center" colspan="5">&nbsp;</td>
          </tr>
        </table></td>
      </tr>
    
    </table>
    
     
    
    <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
     
      <tr>
        <td height="60" align="center"><label>
          <input type="submit" name="button3" id="button4" value="保存" /> &nbsp;&nbsp;&nbsp;&nbsp;
          <input type="button" name="button3" id="button6" value="取消" onclick="javascript:history.back(-1);"/>
        </label></td>
      </tr>
    </table>
  </div>
  
</form>
</body>
</html>

